package com.atguigu.gmall.search.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "guigunews")
public class News {
    @Id
    private Long id;
    @Field("content")
    private String content;
    @Field("pn")
    private String publisherName;
    @Field(value = "pubDate",type = FieldType.Date,format = DateFormat.custom , pattern = "yyyy-MM-dd HH:mm:ss")
    private Date pubDate;
    @Field("viewCount")
    private Integer viewCount;
}
